<template>
    <div class="container-activity">
        <el-row class="wrap-search">
            <div class="search-item">
                <div class="search-title">姓名：</div>
                <el-input style="width: 200px;" class=""
                placeholder="请输入姓名"
                v-model="configList.param.trueNameLike" ></el-input>
            </div>
            <el-button  class="search-btn" type="primary" @click="getList()">查询</el-button>
        </el-row>
        <div class="">
            <table-list ref="tableList" :tableConfig='configList'>
                 <el-table-column class="btn" label="反馈内容" slot="contents" align="center" >
                    <template slot-scope="scope">
                       <div class="contents">{{scope.row.contents}}</div>
                    </template>
                  </el-table-column>
                  <el-table-column class="btn" label="操作" slot="btn" align="center" >
                    <template slot-scope="scope">
                       <el-button  type="primary" @click="$router.push('/adviceDetail?id='+scope.row.id)" size="mini" >查看</el-button>
                       <el-button  class="search-btn" size="small" type="danger" @click="delLevel(scope.row.id)">删除</el-button>
                    </template>
                  </el-table-column>
            </table-list>
        </div>
    </div>
</template>

<script>
let CONSTANT = require('../../constant/constant.js');
let common = require("../../common.js");
export default {
    data() {
        return { 
            configList:{
                url:CONSTANT.URL.ACTIVITY.ADVICELIST,
                configList:[
                    {
                       label:'姓名',
                       prop:'trueName'
                    },
                    {
                       label:'反馈时间',
                       prop:'gmtCreated'
                    },
                    {
                       label:'邮箱',
                       prop:'email'
                    },
                     {
                      slot:'contents'
                    },
                    {
                      slot:'btn'
                    }
                ],
                param:{
                    trueNameLike:''
                },
                type:'',
                width:'',
                isPagination:true
            },
            dialogVisible:false,
            dialogVisible1:false,
            imgUrl:'',
            upLoadUrl:'',
            dataList:[]
        }
    },
    components: {
        'table-list':() => import('../common/my-table')
    },  
    mounted() {
    },
    methods: {
        getList(){
            this.$refs.tableList.getList()
        },
        delLevel(id){
            this.$confirm('确定删除?', '提示', {           
                confirmButtonText: '确定',           
                cancelButtonText: '取消',           
                type: 'warning'         
            }).then(() => {           
                let  url = CONSTANT.URL.ACTIVITY.ADVICEDELETE,
                    param = {id:id}
                common.requestAjax(url,{},param,(res)=>{
                    if(res.status == 200){
                        this.$message({
                            type: 'success',
                            message:res.msg
                        });
                        this.getList();
                    }else{
                        this.$message({           
                            message: res.msg,           
                            type: 'warning'         
                        });
                    }
                }) 
   
            }).catch(() => {           
                this.$message({             
                    type: 'info',             
                    message: '已取消删除'           
                });                   
            });   
        },
    }
}
</script>

<style lang="scss">
    .container-activity {
        .contents{
            overflow: hidden;
            text-overflow: ellipsis;
            white-space:nowrap;
        }
        .wrap-search{
            margin-bottom: 20px;
            .search-item{
                float: left;
                margin-right: 20px;
                margin-top: 20px;
            }
            button{
                float: left;
                margin-top: 20px;
            }
            .search-title{
                display: inline;
                width: 100px;
                height: 36px;
                line-height: 36px;
                text-align: right;
                margin-bottom: 20px;
                margin-right: 10px;
            }
        }
        .el-table__row{

            video{
                width: 100px;height: auto;
            }
            img.activity{
                width: 150px;height: auto;
                cursor: pointer;
            }
        }
        .pagination {
            text-align: center;
            width: 80%;
            margin-top: 60px;
        }
        .el-dialog__body{
            img{
                display: block;
                margin: 0 auto;
                width: 400px;
            }
        }
        .user-num{
            color:#409EFF;
            cursor: pointer;
        }
        
        .avatar{
            width: 50px!important;
            height: 50px;
            border-radius: 50%;
            -webkit-border-radius: 50%;
        }
    }
</style>
